<template>
  <div>
    <img src="../img/Snipaste_2022-11-08_11-25-13.png" v-if="flag">
       <button @click="fn()">点击以后显示和隐藏</button>
   </div>
</template>
 
<script>
export default {
  data() {
    return {
        flag:true,
    };
  },
  methods: {
    fn() {
      this.flag =!this.flag  
    }
  }
};
</script>

<style scoped>
     img {
        width: 600px;
        height: 600px;
     }
</style>